home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-120.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  44.2 KB  |  1,235 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Mon, 22 Jun 92       Volume 1 : Issue 120
  2.  
  3. Today's Topics:
  4.  
  5.     Getting A5 in VBL tasks
  6.     How to center Alerts?
  7.     Fun with FindFolder
  8.     Think C 4 & 5
  9.     SetLineWidth question
  10.     Image measurement for the Mac ??
  11.     Are "virtual" (software) monitors possible?
  12.     detecting when a volume or floppy is mounted, how?
  13.     Two questions
  14.     HOW do I get the finder to update its file information..
  15.     Need Graphics Book Rec
  16.  
  17.  
  18. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  19.  
  20. These digests are available (by using FTP, account anonymous, your email
  21. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  22. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  23. Questions list.  The last several issues of the digest are available from
  24. sumex-aim.stanford.edu as well.
  25.  
  26. These digests are also available via email.  Just send a note saying that you
  27. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  28. automatically receive each new digest as it is created.
  29.  
  30. The digest is a collection of articles from the internet newsgroup comp.sys.
  31. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  32. and want an archive of the discussions.  If you don't know what a newsgroup
  33. is, you probably don't have access to it.  Ask your systems administrator(s)
  34. for details.  (This means you can't post questions to the digest.)
  35.  
  36. The articles in these digests are taken directly from comp.sys.mac.programmer.
  37. They are not edited; all articles included in this digest are in their original
  38. posted form.  The only articles that are -not- included in these digests are
  39. those which didn't receive any replies (except those that give information
  40. rather than ask a question).  All replies to each article are concatenated
  41. onto the original article in the order in which they were received.  Article
  42. threads are not added to the digests until the last article added to the
  43. thread is at least one month old (this is to ensure that the thread is dead
  44. before adding it to the digests).
  45.  
  46. Send administrative mail to mkelly@cs.uoregon.edu.
  47.  
  48. -------------------------------------------------------
  49.  
  50. From: anarch@bonaire.dartmouth.edu (The Anarch)
  51. Subject: Getting A5 in VBL tasks
  52. Date: 13 May 92 00:33:52 GMT
  53. Organization: Secular Humanists from Hell
  54.  
  55.  
  56.      Now that SetUpA5 and RestoreA5 should not be used, how are people
  57. getting globals in VBL tasks?  IM VI doesn't seem to address it.  I've read
  58. the stuff about using refCons to pass A5, but of course you don't have
  59. any refCons for VBL tasks (or do you?  Maybe I've missed something).  I
  60. don't want to use the Time Manager because this is for animation.  I can
  61. think of one way to do it, storing A5 into the body of the task code, but
  62. IM VI *does* mention this approach and discourages it.  Any other ideas?
  63.  
  64. - -- 
  65. +-+-+-+-+-+-+-+-+-+-+-+anarch@bonaire.dartmouth.edu-+-+-+-+-+-+-+-+-+-+-+-+-+
  66.    "The Walpurgisnacht has become synonomous with any general revelry, and
  67.      particularly for the breaking out of demonic lewdness and disorder."
  68. D I S C L A I M E R :   E V E R Y T H I N G   I   W R I T E   I S   F A L S E
  69.  
  70. +++++++++++++++++++++++++++
  71.  
  72. From: wysocki@husc.harvard.edu (Chris Wysocki)
  73. Date: 13 May 92 14:40:23 GMT
  74. Organization: Harvard University, Cambridge, MA
  75.  
  76. In article <1992May13.003352.28376@dartvax.dartmouth.edu>, anarch@bonaire.dartmouth.edu (The Anarch) writes:
  77.  
  78. >      Now that SetUpA5 and RestoreA5 should not be used, how are people
  79. > getting globals in VBL tasks?
  80.  
  81. When a VBL task is called, A0 points to the VBLTask record associated
  82. with the VBL task.  You can take advantage of this by storing the proper
  83. value of A5 just *before* the VBLTask record.  In C, you would declare a
  84. struct such as:
  85.  
  86.     typedef struct {
  87.         long    curA5;
  88.         VBLTask vbl;
  89.     } MyVBLTask;
  90.  
  91. and put the current value of A5 in the curA5 field when installing the
  92. VBL task.  Your VBL task can then get the correct value of A5 from
  93. - -4(A0).  If it isn't obvious, A5 should be set up in this manner before
  94. doing anything that might trash the contents of A0.
  95.  
  96. (All of this is documented in the original "Programmer's Guide to
  97. MultiFinder", but it appears that this information didn't make it into
  98. the Memory Management chapter in IM VI.)
  99.  
  100. Chris Wysocki
  101. wysocki@husc.harvard.edu
  102.  
  103. +++++++++++++++++++++++++++
  104.  
  105. From: REEKES@applelink.apple.com (Jim Reekes)
  106. Date: 17 May 92 01:49:01 GMT
  107. Organization: Apple Computer, Inc.
  108.  
  109. In article <1992May13.003352.28376@dartvax.dartmouth.edu>, anarch@bonaire.dartmouth.edu (The Anarch) writes:
  110. >      Now that SetUpA5 and RestoreA5 should not be used, how are people
  111. > getting globals in VBL tasks?  IM VI doesn't seem to address it.  I've read
  112. > the stuff about using refCons to pass A5, but of course you don't have
  113. > any refCons for VBL tasks (or do you?  Maybe I've missed something).  I
  114. > don't want to use the Time Manager because this is for animation.  I can
  115. > think of one way to do it, storing A5 into the body of the task code, but
  116. > IM VI *does* mention this approach and discourages it.  Any other ideas?
  117.  
  118. Read Tech Note 180.  It even has the exact code you're asking for.
  119.  
  120. - -----------------------------------------------------------------------
  121. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  122.                              |          Sound Manager Expert
  123. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  124. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  125. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  126.  
  127. ---------------------------
  128.  
  129. From: jryan@adobe.com (Jim Ryan)
  130. Subject: How to center Alerts?
  131. Date: 12 May 92 20:43:11 GMT
  132. Organization: Adobe Systems Incorporated
  133.  
  134. How does one center an alert?  I'm using Think C.
  135.  
  136. Thanks,
  137. Jim Ryan
  138.  
  139. +++++++++++++++++++++++++++
  140.  
  141. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  142. Date: 13 May 92 04:28:52 GMT
  143. Organization: University of Waikato, Hamilton, New Zealand
  144.  
  145. In article <1992May12.204311.27370@adobe.com>, jryan@adobe.com (Jim Ryan) writes:
  146. > How does one center an alert?  I'm using Think C.
  147.  
  148. Congratulations! You've discovered the main reason for giving up on ALRTs,
  149. and using DLOGs exclusively.
  150.  
  151. Lawrence
  152. resident VideoBigot and QuickTime enthusiast
  153.  
  154. +++++++++++++++++++++++++++
  155.  
  156. From: phils@chaos.cs.brandeis.edu (Phil Shapiro)
  157. Date: 13 May 92 14:26:54 GMT
  158. Organization: Symantec Corp.
  159.  
  160. In article <1992May13.162852.8062@waikato.ac.nz> ldo@waikato.ac.nz
  161. (Lawrence D'Oliveiro, Waikato University) writes:
  162.  
  163.    In article <1992May12.204311.27370@adobe.com>, jryan@adobe.com (Jim
  164.    Ryan) writes:
  165.   > How does one center an alert?  I'm using Think C.
  166.  
  167.    Congratulations! You've discovered the main reason for giving up on
  168.    ALRTs, and using DLOGs exclusively.
  169.  
  170. Hmm, I'm not sure what you mean by this -- both DLOGs and ALRTs can be
  171. centered using the same code. If you're using THINK C, you can use the
  172. PositionDialog() routine in TBUtilities.c, which is provided with the
  173. TCL.
  174.  
  175.     -phil
  176. - --
  177.    Phil Shapiro                                   Software Engineer
  178.    Language Products Group                     Symantec Corporation
  179.            Internet: phils@cs.brandeis.edu
  180.  
  181. +++++++++++++++++++++++++++
  182.  
  183. From: mxmora@unix.SRI.COM (Matt Mora)
  184. Date: 14 May 92 01:54:00 GMT
  185. Organization: SRI International, Menlo Park, California
  186.  
  187. In article <1992May13.162852.8062@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  188. >In article <1992May12.204311.27370@adobe.com>, jryan@adobe.com (Jim Ryan) writes:
  189. >> How does one center an alert?  I'm using Think C.
  190. >
  191. >Congratulations! You've discovered the main reason for giving up on ALRTs,
  192. >and using DLOGs exclusively.
  193.  
  194. Huh? Whats the problem in centering alerts? Read in the alert info
  195. change the coordinates and then call alert. What's so hard about that?
  196.  
  197. If your using system seven just set the bits with resedit.
  198.  
  199. I'm at the WWDC so I can't post the code to show you how to do this
  200. but it is pretty trival.
  201.  
  202. Matt
  203.  
  204.  
  205.  
  206.  
  207. - -- 
  208. ___________________________________________________________
  209. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  210. SRI International           |  my unix  mxmora@unix.sri.com
  211. ___________________________________________________________
  212.  
  213. +++++++++++++++++++++++++++
  214.  
  215. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  216. Date: 14 May 92 03:04:22 GMT
  217. Organization: University of Waikato, Hamilton, New Zealand
  218.  
  219. In article <PHILS.92May13092654@chaos.cs.brandeis.edu>, phils@chaos.cs.brandeis.edu (Phil Shapiro) writes:
  220. > In article <1992May13.162852.8062@waikato.ac.nz> ldo@waikato.ac.nz
  221. > (Lawrence D'Oliveiro, Waikato University) writes:
  222. >
  223. >    In article <1992May12.204311.27370@adobe.com>, jryan@adobe.com (Jim
  224. >    Ryan) writes:
  225. >   > How does one center an alert?  I'm using Think C.
  226. >
  227. >    Congratulations! You've discovered the main reason for giving up on
  228. >    ALRTs, and using DLOGs exclusively.
  229. >
  230. > Hmm, I'm not sure what you mean by this -- both DLOGs and ALRTs can be
  231. > centered using the same code. If you're using THINK C, you can use the
  232. > PositionDialog() routine in TBUtilities.c, which is provided with the
  233. > TCL.
  234.  
  235. Thanks for the clarification about code provided with THINK C. My point was
  236. how you'd implement these sorts of things with Toolbox-level manipulations;
  237. with a DLOG, I can define it to be initially invisible, retrieve the global
  238. window bounds from the resource handle, calculate a new position, and then do
  239. a MoveWindow followed by a ShowWindow to make it appear in the right place.
  240. With an ALRT, I'd have to poke a new window bounds rectangle into the
  241. resource handle in memory before bringing up the alert, which is the sort
  242. of thing I prefer not to do.
  243.  
  244. Lawrence
  245. Born-again Modula-2ist
  246.  
  247. +++++++++++++++++++++++++++
  248.  
  249. From: buckeye@spf.trw.com (John Wallace)
  250. Organization: TRW Data Systems Center, Redondo Beach, CA
  251. Date: Thu, 14 May 92 19:41:32 GMT
  252.  
  253. In article <1992May13.162852.8062@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes:
  254. >In article <1992May12.204311.27370@adobe.com>, jryan@adobe.com (Jim Ryan) writes:
  255. >> How does one center an alert?  I'm using Think C.
  256. >
  257. >Congratulations! You've discovered the main reason for giving up on ALRTs,
  258. >and using DLOGs exclusively.
  259. >
  260. >Lawrence
  261. >resident VideoBigot and QuickTime enthusiast
  262.  
  263.  
  264. Do something like this:
  265.  
  266. function CenteredAlert(alertId:Integer; filterProc:ProcPtr):Integer;
  267.   var 
  268.     alert : AlertTHndl;
  269.     hSize, vSize : Integer;
  270.     screenBounds : Rect;
  271. begin
  272.     (* Load the alert resource and compute is size on the screen *)
  273.     alert := AlertTHndl(GetResource('ALRT', alertId));
  274.     hSize := alert^^.boundsRect.right - alert^^.boundsRect.left;
  275.     vSize := alert^^.boundsRect.bottom - alert^^.boundsRect.top;
  276.  
  277.     (* Comptute the center of the main screen *)
  278.     screenBounds := GetMainDevice^^.gdRect;
  279.     hCenter := (screenBounds.left + screenBounds.right) div 2;
  280.     vCenter := (screenBounds.top + screenBounds.bottom) div 2;
  281.  
  282.     (* Set the alert's bounds so it will be centered on the main screen *)
  283.     alert^^.boundsRect.left := hCenter - (hSize div 2);
  284.     alert^^.boundsRect.right := alert^^.boundsRect.left + hSize;
  285.     alert^^.boundsRect.top := vCenter - (vSize div 2);
  286.     alert^^.boundsRect.top := alert^^.boundsRect.left + vSize;
  287.  
  288.     (* Bring up the alert.  When Alert calls GetResource it will
  289.      * find the info we just set in the alert's resource. Note
  290.      * that this info is only in memory; it won't be written
  291.      * to disk unless we called ChangeResource and then
  292.      * write it to disk using WriteResource. (You probably don't
  293.      * want to write the info to disk, since the whole point
  294.      * is to properly position the Alert on any display system.)
  295.      *)
  296.     CenteredAlert := Alert(alertId, filterProc)
  297. end;
  298.  
  299. (Sorry in advance for any typos.  I don't have a Mac handy
  300. to test this code on.)
  301.  
  302. Cheers!
  303. John
  304. - ---
  305. John Wallace        buckeye@spf.trw.com
  306.  
  307. +++++++++++++++++++++++++++
  308.  
  309. From: mauser@intercon.com (Richard Chandler)
  310. Date: 16 May 92 03:01:16 GMT
  311. Organization: InterCon Systems Corporation
  312.  
  313. {Code example deleted}
  314.  
  315. If you know you're going to use this technique, you can save yourself a 
  316. little computation by putting the topleft of the alert at (0, 0), then the 
  317. bottom and right coordinates give you your width and height.
  318.  
  319. I think there was a human interface guidline that suggested not exactly 
  320. centering the alert, but theoretically having the top aligned with an 
  321. imaginary line 1/3 of the way down the screen.  Aesthetically that's a bit 
  322. bette anyway.
  323.  
  324.  
  325. - --
  326. Praying for the day when "Sex Scandal" is an oxymoron.
  327. "Ride a motorcycle.  Save Gas, Oil, Rubber, Steel, Aluminum, Parking Spaces,
  328.  The Environment, and Money.  Plus, you get to wear all the leather you want!"
  329.  Rich Chandler, DoD #296
  330.  
  331. +++++++++++++++++++++++++++
  332.  
  333. From: nilesinc@well.sf.ca.us (Avi Rappoport)
  334. Date: 18 May 92 23:48:42 GMT
  335. Organization: Whole Earth 'Lectronic Link
  336.  
  337. John Wallace            buckeye@spf.trw.com
  338.  
  339. Did a good job with this, and his code should work.  It's easy to 
  340. change it to 1/3 of the way down the screen.
  341.  
  342. 2 problems:
  343.  
  344. 1) How do you decide which is the "active" screen?  It's either the 
  345. location of the majority of the active window, or the screen on which
  346. the cursor is located -- I never got a chance to test this with users.
  347.  
  348. 2) You have to cope with Radius etc. monitors, which change screenbits.
  349. bounds and create a region rather than a rect.  I have some code somewhere,
  350. but again, never got to test it.
  351.  
  352. Anyone else?
  353.  
  354. - -- 
  355. - --  Ask me about EndNote and EndNote Plus Bibliography Makers            --
  356. Avi Rappoport                               2000 Hearst, Berkeley, CA 94709
  357. nilesinc@well.sf.ca.us,                                        510-649-8176
  358. Niles.Assoc on AppleLink                              fax: 510-649-8179                 
  359.  
  360. +++++++++++++++++++++++++++
  361.  
  362. From: buckeye@spf.trw.com (John Wallace)
  363. Organization: TRW Data Systems Center, Redondo Beach, CA
  364. Date: Tue, 19 May 92 22:07:07 GMT
  365.  
  366. In article <nilesinc.706232922@well.sf.ca.us> nilesinc@well.sf.ca.us (Avi Rappoport) writes:
  367. >
  368. >2) You have to cope with Radius etc. monitors, which change screenbits.
  369. >bounds and create a region rather than a rect.  I have some code somewhere,
  370. >but again, never got to test it.
  371. >
  372.  
  373. I haven't been able to test the code on Radius monitors, so I don't
  374. know whether the original code will work on them for certain.
  375.  
  376. However, in the code, I get the main graphics device and then find
  377. its bounds rect.  (The main graphics device is the one with the
  378. menubar on it.)  I would guess that Radius sets up its GWorlds
  379. properly, otherwise all sorts of things would fail on their 
  380. monitors.  Does anyone know for certain??
  381.  
  382. Thanks
  383. John
  384.  
  385. - ----
  386. John Wallace    buckeye@spf.trw.com
  387.  
  388.  
  389. +++++++++++++++++++++++++++
  390.  
  391. From: nilesinc@well.sf.ca.us (Avi Rappoport)
  392. Date: 20 May 92 22:16:52 GMT
  393. Organization: Whole Earth 'Lectronic Link
  394.  
  395. In <2A197C0B.9B8@deneva.sdd.trw.com> buckeye@spf.trw.com (John Wallace) writes:
  396.  
  397. >I haven't been able to test the code on Radius monitors, so I don't
  398. >know whether the original code will work on them for certain.
  399.  
  400. >However, in the code, I get the main graphics device and then find
  401. >its bounds rect.  (The main graphics device is the one with the
  402. >menubar on it.)  I would guess that Radius sets up its GWorlds
  403. >properly, otherwise all sorts of things would fail on their 
  404. >monitors.  Does anyone know for certain??
  405.  
  406.  
  407. Nope.  Radius doesn't use GWorlds at all, just screenbits.bounds.  I think this is because non-color-capable (color-incapable?) Macs don't have GWorlds.  And 
  408. things do fail.
  409.  
  410. Avi
  411.  
  412.  
  413.  
  414. (space added to fool fascist news program)
  415.  
  416. - -- 
  417. - --  Ask me about EndNote and EndNote Plus Bibliography Makers            --
  418. Avi Rappoport                               2000 Hearst, Berkeley, CA 94709
  419. nilesinc@well.sf.ca.us,                                        510-649-8176
  420. Niles.Assoc on AppleLink                              fax: 510-649-8179                 
  421.  
  422. ---------------------------
  423.  
  424. From: jryan@adobe.com (Jim Ryan)
  425. Subject: Fun with FindFolder
  426. Date: 15 May 92 18:24:50 GMT
  427. Organization: Adobe Systems Incorporated
  428.  
  429.  
  430. OK, my prefs code is getting close.  A BIG thanks to all who have given 
  431. me all the great feedback! I went the resource route, but now 
  432. FindFolder is giving me fits.  
  433.  
  434. FindFolder returns the blessed System volume number and the 
  435. "directory ID," right?  My code will currently save and retrieve 
  436. the Prefs file to the blessed System Folder under System 6, however 
  437. passing the FindFolder results to SetVol(theDirID, theSysVRefNum) puts my
  438. prefs file in the same folder as my app when running 7.0.
  439. What am I doing wrong?  Below is part of my code:
  440.  
  441. - ------------------------------------------------------------------------------
  442. // this is the struct where I store the pref values
  443. //--------------------------------------------------
  444. typedef    struct {
  445.     int            cp, tp, in, cm, clear, position, horiz, vert;
  446. } prefSettings;
  447.  
  448. extern prefSettings    gPrefStruct;
  449.  
  450. // this is the function that writes the prefs out
  451. //--------------------------------------------------
  452. void WritePrefs(void)  // write out prefs file before quiting
  453. {
  454.     OSErr        theError;
  455.     SysEnvRec    SysEnvData;
  456.     int            theSysVRefNum, theDirID, theFileRefNum;
  457.     Handle        resHandle;
  458.     
  459.     // set Handle to struct size
  460.     resHandle = NewHandle(sizeof(gPrefStruct));
  461.     
  462.     // get system data
  463.     theError = SysEnvirons(1, &SysEnvData);
  464.     
  465.     if (theError == noErr) {
  466.         // if System 7
  467.         if (SysEnvData.systemVersion >= 0x0700) {
  468.             // find Preference folder
  469.             FindFolder(kOnSystemDisk, kPreferencesFolderType, 
  470.                                     kCreateFolder, &theSysVRefNum, &theDirID);
  471.                         SetVol(theDirID, theSysVRefNum);
  472.         }
  473.         else {
  474.             theSysVRefNum = SysEnvData.sysVRefNum;
  475.    SetVol(nil, theSysVRefNum);
  476.         }
  477.         
  478.         // always remove old prefs
  479.         FSDelete("\pThe Prefs", theSysVRefNum);
  480.         
  481.         
  482.         // always create new prefs file
  483.         theError = Create("\pThe Prefs", theSysVRefNum, 'ABCD', 'pprf');
  484.         
  485.         //create resource fork in the prefs file
  486.         CreateResFile("\pThe Prefs");
  487.             
  488.         if (theError == noErr) {
  489.             // open prefs file
  490.             theFileRefNum = OpenResFile("\pThe Prefs");
  491.             
  492.             // add a resourse to the prefs file
  493.             AddResource(resHandle, 'STUF', 128, "\prefs");
  494.             
  495.             if (ResError() == 0) {
  496.                 // get the resource so we can play with it            
  497.                 resHandle = GetResource('STUF', 128);
  498.                 
  499.                 // toss the prefs struct info into the resource
  500.                 HLock(resHandle);
  501.                 BlockMove((Ptr)&gPrefStruct, *resHandle, (long) sizeof(prefSettings));
  502.                 HUnlock(resHandle);
  503.                 
  504.                 // let the resource manager know we're done playing
  505.                 ChangedResource(resHandle);
  506.                 WriteResource(resHandle);
  507.                 
  508.                 // close the prefs resource file
  509.                 CloseResFile(theFileRefNum);
  510.             }
  511.         }
  512.     }
  513. }
  514.  
  515. // and this is the function that gets the prefs
  516. //---------------------------------------------------
  517. void GetPrefs(void) // gets prefs from prefs file
  518. {
  519.     OSErr        theError;
  520.     SysEnvRec    SysEnvData;
  521.     int            theSysVRefNum, theDirID, theFileRefNum;
  522.     Handle        resHandle;
  523.         
  524.     // get blessed System Folder
  525.     theError = SysEnvirons(1, &SysEnvData);
  526.     
  527.     if (theError == noErr) {
  528.         // if System 7
  529.         if (SysEnvData.systemVersion >= 0x0700) {
  530.             // find Preference folder
  531.             FindFolder(kOnSystemDisk, kPreferencesFolderType, 
  532.                                     kCreateFolder, &theSysVRefNum, &theDirID);
  533.    SetVol(theDirID, theSysVRefNum);
  534.         }
  535.         else {
  536.             theSysVRefNum = SysEnvData.sysVRefNum;
  537.    SetVol(nil, theSysVRefNum);
  538.         }
  539.         
  540.         // open prefs file
  541.         theFileRefNum = OpenResFile("\pThe Prefs");
  542.             
  543.         if (theFileRefNum != -1) {
  544.             // get the resource so we can play with it                
  545.             resHandle = GetResource('STUF', 128);
  546.             
  547.             if (resHandle != nil) {
  548.                 // get info from the resource and place it in the prefs struct
  549.                 HLock(resHandle);
  550.                 BlockMove(*resHandle, (Ptr)&gPrefStruct, (long) sizeof(prefSettings));
  551.                 HUnlock(resHandle);
  552.             }
  553.             else {
  554.                 TheErrorHandler(PREFS_ERROR);
  555.                 SetDefaults();
  556.             }
  557.             
  558.             // close the prefs file
  559.             CloseResFile(theFileRefNum);
  560.             
  561.             // check and make sure we got good data
  562.             DoPrefsCheck();
  563.         }
  564.         // if no prefs file, or problem, set defaults
  565.         else {
  566.             SetDefaults();
  567.         }
  568.     }
  569.     // if SysEnvirons returns error, then so do we
  570.     else { 
  571.         TheErrorHandler(SYSTEM_ERROR);
  572.     }
  573. }
  574. - ------------------------------------------------------------------------------
  575.  
  576. Any suggestons to clean this code up would also be greatly appreciated.
  577.  
  578. Thanks again,
  579. jr
  580.  
  581. +++++++++++++++++++++++++++
  582.  
  583. From: keith@taligent.com (Keith Rollin)
  584. Date: 19 May 92 23:16:32 GMT
  585. Organization: Taligent
  586.  
  587. In article <1992May15.182450.3530@adobe.com>, jryan@adobe.com (Jim Ryan) writes:
  588. > OK, my prefs code is getting close.  A BIG thanks to all who have given 
  589. > me all the great feedback! I went the resource route, but now 
  590. > FindFolder is giving me fits.  
  591. > FindFolder returns the blessed System volume number and the 
  592. > "directory ID," right?  My code will currently save and retrieve 
  593. > the Prefs file to the blessed System Folder under System 6, however 
  594. > passing the FindFolder results to SetVol(theDirID, theSysVRefNum) puts my
  595. > prefs file in the same folder as my app when running 7.0.
  596. > What am I doing wrong?  Below is part of my code:
  597. > [ code deleted ]
  598. > Any suggestons to clean this code up would also be greatly appreciated.
  599. >
  600.  
  601. I don't know what's going wrong, but I wouldn't bother even trying to find out.
  602. Just get rid of the call to SetVol. You don't need it, and it's obviously
  603. causing you problems. Get rid of it and call HOpenResFile and HCreateResFile
  604. instead.
  605.  
  606. - --
  607. Keith Rollin
  608. Phantom Programmer
  609. Taligent, Inc.
  610.  
  611. ---------------------------
  612.  
  613. From: Justin Harvey
  614. Subject: Think C 4 & 5
  615. Date: 15 May 92 21:39:56 GMT
  616. Organization: University of Alaska, Southeast
  617.  
  618. I am a High School C Programmer here at Juneau-Douglas High School and my
  619. computer lab teacher has TC 4.5 which is the System 7 comp. version. 
  620. I was wondering if there is an update package for 4 -> 5 and if so is it worth
  621. changing?
  622.     Thanks,
  623.         Justin Harvey
  624.  
  625.  
  626. +++++++++++++++++++++++++++
  627.  
  628. From: jerry@uni-paderborn.de (Gerald Siek)
  629. Date: 20 May 92 11:31:37 GMT
  630. Organization: Uni-GH Paderborn
  631.  
  632. Justin Harvey writes:
  633.  
  634. >I am a High School C Programmer here at Juneau-Douglas High School and my
  635. >computer lab teacher has TC 4.5 which is the System 7 comp. version. 
  636. >I was wondering if there is an update package for 4 -> 5 and if so is it worth
  637. >changing?
  638.  
  639. >I am a High School C Programmer here at Juneau-Douglas High School and my
  640. >computer lab teacher has TC 4.5 which is the System 7 comp. version. 
  641. >I was wondering if there is an update package for 4 -> 5 and if so is it worth
  642. >changing?
  643.  
  644. There is ... and it's worth buying (sorry, update 4 -> 5 isn't free).  
  645. Version 5 eliminates quite some bugs and memory restrictions.  It has 
  646. a lot more compiler-, language- and optimization options.
  647. I was porting a HUGE and complicated UNIX program with version 4 and it 
  648. simply failed because of the memory limitations.  With version 5 all runs 
  649. fine, especially the debugger can now handle the whole code (330.000 lines)
  650. with no problems.
  651.  
  652.         Jerry
  653. - -- 
  654.   Gerald Siek  -  jerry@uni-paderborn.de  -  University of Paderborn, Germany
  655.  
  656. ---------------------------
  657.  
  658. From: kresch@vu-vlsi.vill.edu (Ed Kresch)
  659. Subject: SetLineWidth question
  660. Date: 19 May 92 15:44:46 GMT
  661. Organization: Villanova University
  662.  
  663. I have a question about SetLineWidth and the explanation of it given in
  664. Technical Note 175.  According to my understanding of TN175, the C program
  665. shown below should draw a thin line, a thick line, and a thin line.  What it
  666. does is draw a thin line and two thick lines.  Did I misunderstand the
  667. technical note or is there an error somewhere?
  668.  
  669.         theWidth = (Point**)NewHandle (sizeof (Point));
  670.  
  671. /* Draw a horizontal line of 1 point thickness */
  672.  
  673.         SetPt (*theWidth, 1, 1);
  674.         PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  675.         PenSize (1, 1);
  676.         MoveTo (100, 100);
  677.         LineTo (500, 100);
  678.  
  679. /* Draw a horizontal line of 5 point thickness */
  680.  
  681.         SetPt (*theWidth, 1, 5);
  682.         PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  683.         MoveTo (100, 200);
  684.         LineTo (500, 200);
  685.  
  686. /* Draw a horizontal line of 1 point thickness */
  687.  
  688.         SetPt (*theWidth, 1, 1);
  689.         PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  690.         PenSize (1, 1);
  691.         MoveTo (100, 300);
  692.         LineTo (500, 300);
  693.  
  694.         DisposHandle (theWidth);
  695.  
  696. I am using a Mac II and system 6.0.5.
  697.  
  698. Thanks.
  699.  
  700. Ed Kresch
  701.  
  702. +++++++++++++++++++++++++++
  703.  
  704. From: unity@mcl.mcl.ucsb.edu (Pete Gontier)
  705. Date: 20 May 92 17:26:36 GMT
  706.  
  707. In <1992May19.154446.11416@vu-vlsi.vill.edu> kresch@vu-vlsi.vill.edu (Ed Kresch) writes:
  708.  
  709. >I have a question about SetLineWidth and the explanation of it given in
  710. >Technical Note 175.  According to my understanding of TN175, the C program
  711. >shown below should draw a thin line, a thick line, and a thin line.  What it
  712. >does is draw a thin line and two thick lines.  Did I misunderstand the
  713. >technical note or is there an error somewhere?
  714.  
  715. >        SetPt (*theWidth, 1, 5);
  716. >        PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  717. >    /* draw stuff */
  718.  
  719. >        SetPt (*theWidth, 1, 1);
  720. >        PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  721. >    /* draw stuff */
  722.  
  723. >I am using a Mac II and system 6.0.5.
  724.  
  725. It's not your machine or your System version. It's not even the version of
  726. your printer driver. It's a problem at the driver level. Different drivers
  727. do different things with this comment. Don't ask me why; Zz keeps threatening
  728. to write a tech note about it; I think he actually did write something
  729. recently, perhaps in d e v e l o p. Your code needs to look like this:
  730.  
  731. /* group one */
  732. SetPt (*theWidth, 1, 5);
  733. PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  734. /* draw stuff */
  735.  
  736. /* group two */
  737. SetPt (*theWidth, 5, 1);
  738. PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  739. /* draw stuff */
  740.  
  741. /* group three */
  742. SetPt (*theWidth, 1, 1);
  743. PicComment (SetLineWidth, sizeof (Point), (Handle)theWidth);
  744. /* draw stuff */
  745.  
  746. Group one sets the line width to what you want. Group two sets it back to
  747. its original size for some printers. Group three sets it back to its
  748. original size for the others (and doesn't affect the group 2 printers,
  749. since they're already at 1,1).
  750.  
  751. I consider this a bug, but then the differences between MemError, ResError,
  752. and QDError are a bug as far as I'm concerned, so I'm a weenie.
  753. - --
  754.  Pete Gontier // EC Technology // unity@mcl.ucsb.edu
  755.  
  756. ---------------------------
  757.  
  758. From: johnwl@kean.ucs.mun.ca
  759. Subject: Image measurement for the Mac ??
  760. Organization: Memorial University. St.John's Nfld, Canada
  761. Date: Thu, 21 May 1992 14:22:46 GMT
  762.  
  763. Hello !
  764.  
  765.   could anyone on this group supply me with information regarding an image
  766. MEASUREMENT system I could use on digitized photographs on a Macintosh
  767. computer ?  I am looking for PD/Shareware or commercial software that will
  768. permit me to measure scanned pictures (in TIFF or PICT or GIF format) of fish
  769. otoliths (ear bones) to within at least 0.1 mm.
  770.   There are commercial packages for the PC that will do this (Optimus, for
  771. example), but I would rather not spend $20K just to get this system on-line !
  772. Surely there is something I could use for the Mac ??
  773.   I have access to colour or black and white, and have tried Image 3.1.1 and
  774. MacMeasure to no avail.
  775.   Any help with this would be greatly appreciated !                       
  776.                                                 regards, Jack
  777.                                             johnwl@kean.ucs.mun.ca
  778.  
  779. +++++++++++++++++++++++++++
  780.  
  781. From: des7f@fulton.seas.Virginia.EDU (David E. Sappington)
  782. Organization: University of Virginia
  783. Date: Thu, 21 May 1992 15:42:57 GMT
  784.  
  785. In article <1992May21.105246.1@kean.ucs.mun.ca> johnwl@kean.ucs.mun.ca writes:
  786. [ wants to measure stuff in scanned images ]
  787.  
  788. I haven't used it extensively (and never for measuring stuff) but you
  789. might want to check out Image 1.44 by Wayne Rasband at NIH.  It's available
  790. via anon-ftp from alw.nih.gov (128.231.128.7) in pub/image.  The Pascal
  791. source code is there as well so that you can add functionality if necessary.
  792.  
  793. Dave Sappington                     des7f@virginia.edu
  794. Institute for Parallel Computation  des7f@virginia.bitnet
  795. University of Virginia
  796.  
  797.  
  798. ---------------------------
  799.  
  800. From: olsone@vccsouth08.its.rpi.edu (Erik G. Olson)
  801. Subject: Are "virtual" (software) monitors possible?
  802. Organization: Rensselaer Polytechnic Institute, Troy NY
  803. Date: Sat, 16 May 1992 06:25:34 GMT
  804.  
  805. Hi. I'm rather new to programming the Macintosh, and was wondering if
  806. anyone would comment on what I would need to learn about to pull off
  807. a (rather silly) system hack:
  808.  
  809. Let's say I have a graphics device hooked up to my serial port. Never
  810. mind how it works; just suppose one can write Mac programs that
  811. put bitmapped graphics onto it, make it do drawing primitives, etc.
  812.  
  813. Now, my question is, how could you fool the operating system into
  814. thinking that there actually existed a monitor out there that had
  815. to be dealt with by making calls to our special software that 
  816. controls this graphics device? And how could we make this usable
  817. as part of the desktop?
  818.  
  819. Is this crazy or what? 
  820.  
  821.  
  822. - -- 
  823. Erik G. Olson                =+ Where am I? Tell the truth--
  824. olsone@rpi.edu               =+ I can bear it. In what quarter of the globe
  825.                              =+ Have I descended like a meteorite?
  826.                              =+ ---Cyrano de Bergerac, Act III
  827.  
  828. +++++++++++++++++++++++++++
  829.  
  830. From: absurd@applelink.apple.com (Tim Dierks, software saboteur)
  831. Date: 20 May 92 03:09:41 GMT
  832. Organization: MacDTS Misfits
  833.  
  834. In article <9!3v6vl@rpi.edu>, olsone@vccsouth08.its.rpi.edu (Erik G. Olson) writes:
  835. > Hi. I'm rather new to programming the Macintosh, and was wondering if
  836. > anyone would comment on what I would need to learn about to pull off
  837. > a (rather silly) system hack:
  838. > Let's say I have a graphics device hooked up to my serial port. Never
  839. > mind how it works; just suppose one can write Mac programs that
  840. > put bitmapped graphics onto it, make it do drawing primitives, etc.
  841. > Now, my question is, how could you fool the operating system into
  842. > thinking that there actually existed a monitor out there that had
  843. > to be dealt with by making calls to our special software that 
  844. > controls this graphics device? And how could we make this usable
  845. > as part of the desktop?
  846.  
  847. Well.... Yes and no.  In QuickDraw, monitors are not really "devices"-
  848. they're frame buffers.  This means that QuickDraw doesn't make calls
  849. to you that you can translate in order to pass the data to your
  850. device; it just attempts to blast everything into a chunk of memory
  851. you have spoecified as your screen memory.  (This isn't 100% true,
  852. but it's probably close enough for the moment.)  Therefore, the
  853. only thing you can do is provide a buffer for QuickDraw to image
  854. into, then pump the buffer over the serial line to your device.
  855. You can find out when & where QuickDraw is drawing to your device
  856. by patching ShieldCursor and ShowCursor; all drawing is bracketed
  857. by calls to these traps.
  858.  
  859. Best of luck.
  860.  
  861. Tim Dierks
  862. MacDTS, but I speak for myself
  863.  
  864. ---------------------------
  865.  
  866. From: iron@imag.fr (Francois Menneteau)
  867. Subject: detecting when a volume or floppy is mounted, how?
  868. Date: 18 May 92 16:30:10 GMT
  869. Organization: IMAG Institute, University of Grenoble, France
  870.  
  871.  
  872. I have an application that gets the mounted volume and displays them. However,
  873. if a volume is mounted after the application is launched, the application is
  874. no information about this volume, and so the user cannot select files from it.
  875.  
  876. I think by patching traps like PBMountVol to notify my application can be a
  877. solution. However each time Apple will release a new trap that mounts vol,
  878. I will be obliged to build again my application.
  879.  
  880. An other solution, would be to regularly get the list of all the mounted
  881. volume, but I'd like to avoid this solution (it is time consuming, not very
  882. logical, and implies code to compare the new volumes list to the old one).
  883.  
  884. So, has anybody a good (and esthetic :-)) solution to my problem?
  885.  
  886. - -- 
  887. Francois Menneteau ()   __|||||__   () "... I had their lives in my hands
  888. ================== ()    /O   O\    () their fate their fortune in my visions
  889. iron@imag.fr       ()    - .|. -    () No one believed in my true prophecy
  890. ================== ()     \=^=/     () And now it's too late."  (Iron Maiden)
  891.  
  892. +++++++++++++++++++++++++++
  893.  
  894. From: REEKES@applelink.apple.com (Jim Reekes)
  895. Date: 19 May 92 19:51:51 GMT
  896. Organization: Apple Computer, Inc.
  897.  
  898. In article <34440@imag.imag.fr>, iron@imag.fr (Francois Menneteau) writes:
  899. > I have an application that gets the mounted volume and displays them. However,
  900. > if a volume is mounted after the application is launched, the application is
  901. > no information about this volume, and so the user cannot select files from it.
  902. > I think by patching traps like PBMountVol to notify my application can be a
  903. > solution. However each time Apple will release a new trap that mounts vol,
  904. > I will be obliged to build again my application.
  905. > An other solution, would be to regularly get the list of all the mounted
  906. > volume, but I'd like to avoid this solution (it is time consuming, not very
  907. > logical, and implies code to compare the new volumes list to the old one).
  908. > So, has anybody a good (and esthetic :-)) solution to my problem?
  909.  
  910. You can poll in your event loop (not every time, but every couple seconds) for
  911. additional volumes that have been mounted.  Just use the indexed calls
  912. to find information about volumes.  This *isn't* time consuming, and it's
  913. also the logical choice.  You don't have to patch anything.  You're already
  914. maintaining the list of vRefNums and the volume name which is a small amount
  915. of data you can keep in an array.  The volume name is limited to a Str27,
  916. so you can keep the size of the array pretty small.  This list will also be
  917. fast to search since it's only going to contain a few items. 20 volumes would
  918. be a big list, but a linear search will be very fast.
  919.  
  920.  
  921. - -----------------------------------------------------------------------
  922. Jim Reekes, Polterzeitgeist  |     Macintosh Toolbox Engineering
  923.                              |          Sound Manager Expert
  924. Apple Computer, Inc.         | "All opinions expressed are mine, and do
  925. 20525 Mariani Ave. MS: 81-KS |   not necessarily represent those of my
  926. Cupertino, CA 95014          |       employer, Apple Computer Inc."
  927.  
  928. +++++++++++++++++++++++++++
  929.  
  930. From: keith@taligent.com (Keith Rollin)
  931. Date: 19 May 92 23:04:14 GMT
  932. Organization: Taligent
  933.  
  934. In article <34440@imag.imag.fr>, iron@imag.fr (Francois Menneteau) writes:
  935. > I have an application that gets the mounted volume and displays them. However,
  936. > if a volume is mounted after the application is launched, the application is
  937. > no information about this volume, and so the user cannot select files from it.
  938. > I think by patching traps like PBMountVol to notify my application can be a
  939. > solution. However each time Apple will release a new trap that mounts vol,
  940. > I will be obliged to build again my application.
  941. > An other solution, would be to regularly get the list of all the mounted
  942. > volume, but I'd like to avoid this solution (it is time consuming, not very
  943. > logical, and implies code to compare the new volumes list to the old one).
  944. > So, has anybody a good (and esthetic :-)) solution to my problem?
  945.  
  946. I would use your second solution. Patching PBMountVol will only work if your
  947. application is active when PBMountVol is called. Similarly, disk-inserted events
  948. are sent only to the frontmost application.
  949.  
  950. Checking for new volumes by polling shouldn't be that bad. First, start with the
  951. following data structure:
  952.  
  953. struct MountedVolume {
  954.     Str31 name;
  955.     long creationDate;
  956.     Boolean mark;
  957.     struct MountedVolume* next;
  958. };
  959.  
  960. Using this, you can create a list of mounted volumes (store the creation date of
  961. the volume to differentiate between identically named volumes). You can then
  962. iterate over the list of currently mounted volumes, finding new entries that you
  963. don't know about. Using the "mark" variable, you can use a mark-and-sweep
  964. technique for detecting entries in your list that refer to now unmounted
  965. volumes.
  966.  
  967. I usually keep 3 or 4 volumes mounted at a time at work. Making 3 to 16 string
  968. comparisons shouldn't make much of an impact if you resync once a second or so.
  969.  
  970. I think that there is a low-memory vector that the File System calls when a
  971. volume is mounted. However:
  972.  
  973. a) I don't think this vector is documented
  974. b) I don't know if it's swapped when your application is swapped out
  975. c) I don't know if it's called when a volume is unmounted.
  976.  
  977. So it's probably not a good idea to use this vector if it indeed exists.
  978.  
  979. - --
  980. Keith Rollin
  981. Phantom Programmer
  982. Taligent, Inc.
  983.  
  984. ---------------------------
  985.  
  986. From: dowlr@WFUNET.WFU.EDU (Ramsey Dow)
  987. Subject: Two questions
  988. Date: 20 May 92 14:04:32 GMT
  989. Organization: Department of Redundancy Department
  990.  
  991. I have two questions for the readership of comp.sys.mac.programmers:
  992.  
  993. 1. Exactly how long is a Mac ms?  Is it precisely 1 ms?  A Mac K is 1024 bytes,
  994.    not 1000.  Is there a similar difference between a ms and a Mac ms?
  995.  
  996. 2. Does the event loop slow down an application's ability to process data
  997.    through a hardware interface?
  998.  
  999. Please respond by email, as I do not read this group very often.  If I get
  1000. some good answers I will post a summary.  Thank you in advance.
  1001.  
  1002. Ramsey Dow
  1003.  
  1004. - -- 
  1005. Ramsey Dow            Internet:  dowlr@wfu.edu  -or-  dowlr@ac.wfunet.wfu.edu
  1006. Nyarlathotep..the crawling chaos..I am the last..I will tell the audient void.
  1007.  
  1008. +++++++++++++++++++++++++++
  1009.  
  1010. From: jcav@quads.uchicago.edu (JohnC)
  1011. Date: 20 May 92 17:28:07 GMT
  1012. Organization: The Royal Society for Putting Things on Top of Other Things
  1013.  
  1014. In article <9205201420.AA03430@ucbvax.Berkeley.EDU> dowlr@WFUNET.WFU.EDU (Ramsey Dow) writes:
  1015. >I have two questions for the readership of comp.sys.mac.programmers:
  1016. >
  1017. >1. Exactly how long is a Mac ms?  Is it precisely 1 ms?  A Mac K is 1024 bytes,
  1018. >   not 1000.  Is there a similar difference between a ms and a Mac ms?
  1019.  
  1020. One kilobyte is defined to be two to the 10th power, or 1024.  This isn't
  1021. Mac-specific.  In ancient times, the Finder used to report disk space and file
  1022. sizes in units of 1000 bytes, and called these units "K"s, but this has long
  1023. since been changed to conform to the standard definition.  So, a "Mac K" _used
  1024. to be_ 1000, but now it's 1024.
  1025.  
  1026. As for "Mac milliseconds", as far as I know they're standard real
  1027. milliseconds. :-)
  1028.  
  1029. >2. Does the event loop slow down an application's ability to process data
  1030. >   through a hardware interface?
  1031.  
  1032. If you mean, does the event loop affect interrupt response, then the answer
  1033. is no.  I'm not sure what you mean, though.
  1034.  
  1035. - -- 
  1036. John Cavallino                  |  EMail: jcav@midway.uchicago.edu
  1037. University of Chicago Hospitals |         John_Cavallino@uchfm.bsd.uchicago.edu
  1038. Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953
  1039. B0 f++ c+ g+ k s++ e+ h- pv     |         Chicago, IL  60637
  1040.  
  1041. ---------------------------
  1042.  
  1043. From: kevin@crash.cts.com (Kevin Hill)
  1044. Subject: HOW do I get the finder to update its file information..
  1045. Date: 21 May 92 23:12:46 GMT
  1046. Organization: Crash TimeSharing, El Cajon, CA
  1047.  
  1048.  
  1049.   I have changed the name of a file with one of my programs.  The file itself
  1050. happens to be in a window that is open.  When I switch to the finder to delete the file
  1051. that is open, I get a "File not found error"  I am assuming that the finder
  1052. has not updated its file information since I changed the name and thus is trying
  1053. to delete a filename that no longer exists.  Is there a way to send the finder
  1054. an event that will tell it to update its file information after I change a
  1055. file name?
  1056.   any help would be appeciated..
  1057.    Thanks everyone!
  1058.    Kevin Hill
  1059.  
  1060. +++++++++++++++++++++++++++
  1061.  
  1062. From: dickie@schaefer.math.wisc.edu (Garth Dickie)
  1063. Date: 22 May 92 01:44:27 GMT
  1064. Organization: Univ. of Wisconsin Dept. of Mathematics
  1065.  
  1066. You need to change the modification date of the parent directory.
  1067. The routine TickleParent below works for me.  In case you are not
  1068. using the FSSpec structure, the routine MakeWDSpec will convert
  1069. a working directory / filename pair to a psuedo-FSSpec.  I use
  1070. this when the new file manager calls are not available, as the rest
  1071. of my code passes around FSSpecs.  The code compiles under THINK C
  1072. 5.0, with the usual headers.
  1073.  
  1074. BTW (mild flame) this is simple enough that it's pretty annoying
  1075. when people don't do it.  Most of the nifty little 'drag-and-drop'
  1076. utilities that have come around recently forget to do this.  Feel
  1077. free to use the code below in any way you see fit.
  1078.  
  1079. OSErr TickleParent( FSSpec * child ) {
  1080.     CInfoPBRec    pb;
  1081.     OSErr         err = noErr;
  1082.  
  1083.     pb.dirInfo.ioCompletion = 0;
  1084.     pb.dirInfo.ioNamePtr = 0;
  1085.     pb.dirInfo.ioVRefNum = child->vRefNum;
  1086.     pb.dirInfo.ioFDirIndex = -1;              // get info based on the DirID
  1087.     pb.dirInfo.ioDrDirID = child->parID;
  1088.     
  1089.     if(( err = PBGetCatInfoSync( &pb )) != noErr ) return err;
  1090.  
  1091.     GetDateTime( &pb.dirInfo.ioDrMdDat );
  1092.  
  1093.     err = PBSetCatInfoSync( &pb );
  1094.  
  1095.     return err;
  1096. }
  1097.  
  1098. OSErr MakeWDSpec( FSSpec *spec, short vRefNum, ConstStr255Param name ) {
  1099.     WDPBRec          parameter;
  1100.     Size             length;
  1101.     OSErr            err;
  1102.     
  1103.     parameter.ioCompletion = 0;
  1104.     parameter.ioNamePtr = 0;
  1105.     parameter.ioVRefNum = vRefNum;
  1106.     parameter.ioWDIndex = 0;
  1107.     parameter.ioWDProcID = 0;
  1108.     parameter.ioWDVRefNum = 0;
  1109.  
  1110.     err = PBGetWDInfoSync( ¶meter );
  1111.  
  1112.     spec->vRefNum = parameter.ioWDVRefNum;
  1113.     spec->parID = parameter.ioWDDirID;
  1114.  
  1115.     length = MIN( *name, sizeof spec->name - 1 );
  1116.     BlockMove( name + 1, spec->name + 1, length );
  1117.     *spec->name = length;
  1118.     
  1119.     return err;
  1120. }
  1121. - -- 
  1122.  
  1123. garth dickie -- dickie@math.wisc.edu -- math agnostic (and student)
  1124.  
  1125. ---------------------------
  1126.  
  1127. From: gft_robert@gsbacd.uchicago.edu (opcode ranger)
  1128. Subject: Need Graphics Book Rec
  1129. Date: 18 May 92 22:07:25 GMT
  1130.  
  1131. I'm a self-taught Mac programmer and I'd like to get a good book that will 
  1132. give me some background on computer graphics (y'know, the really cool stuff
  1133. like in Terminator 2! :->).
  1134.  
  1135. What's a good introductory but non-puffy book?  I seem to remember that there
  1136. is supposedly some standard text by "Van" someone, or no?  Is that any good? 
  1137. I'd like something with good depth and background, but something that will also
  1138. help me learn quickly.
  1139.  
  1140. Replies by e-mail would be much appreciated, since my phone link to this
  1141. newssite is rather expensive.
  1142.  
  1143.  
  1144. Thanks!
  1145.  
  1146. Robert
  1147.  
  1148. - -- 
  1149. ==============================================================================
  1150. = gft_robert@gsbacd.uchicago.edu * "Out there on a darkened road, the lights =
  1151. = are dead and the cars explode" -- "Good Things", Sisters of Mercy           =
  1152. ==============================================================================
  1153.  
  1154. +++++++++++++++++++++++++++
  1155.  
  1156. From: rjacks@austlcm.sps.mot.com (rodney jacks)
  1157. Organization: Motorola Inc, Austin, Texas
  1158. Date: Tue, 19 May 1992 20:14:12 GMT
  1159.  
  1160. In article <1992May18.160725.1@gsbacd.uchicago.edu> gft_robert@gsbacd.uchicago.edu (opcode ranger) writes:
  1161. >I'm a self-taught Mac programmer and I'd like to get a good book that will 
  1162. >give me some background on computer graphics (y'know, the really cool stuff
  1163. >like in Terminator 2! :->).
  1164. >
  1165. >What's a good introductory but non-puffy book?  I seem to remember that there
  1166. >is supposedly some standard text by "Van" someone, or no?  Is that any good? 
  1167. >I'd like something with good depth and background, but something that will also
  1168. >help me learn quickly.
  1169.  
  1170. The book I think you are referring to is "Computer Graphics" by Foley and 
  1171. VanDam (sp?).  While it is a good college-level textbook book, I don't 
  1172. think it one to learn quickly from...
  1173.  
  1174. ***********************************************************************
  1175. **  Rodney Jacks                                                     **
  1176. **  Motorola Inc, Austin, Texas                                      **
  1177. **  E-mail:  rjacks@austlcm.sps.mot.com                              **
  1178. **  Picard asks Worf what he thought of commanding the _Enterprise_  **
  1179. **  "Comfortable chair."     ST.TNG _The Emissary_                   ** 
  1180. ***********************************************************************
  1181.  
  1182.  
  1183. +++++++++++++++++++++++++++
  1184.  
  1185. From: fritsch@fsinfo.cs.uni-sb.de (Lothar Fritsch)
  1186. Date: 21 May 92 07:30:38 GMT
  1187. Organization: Fachschaft Informatik, U of Saarland, FRG
  1188.  
  1189. The book you mean is:
  1190.  
  1191. Computer Graphics - Principles and Practice
  1192. by Foley, van Dam & others.
  1193.  
  1194. Addison-Wesley #12110
  1195.  
  1196. It has about 1200 pages, lots of color images, and lots of stuff to read.
  1197. But if you want a book to quickly learn and look up algorithms, it isn't a
  1198. book for you. They write very extensive about the foudations of computer
  1199. graphics, from CRT to radiosity, but more under the aspect of 'how does it
  1200. work' instead of 'here are the algorithms'.
  1201.  
  1202. Yours,
  1203.  
  1204. Lothar Fritsch
  1205.  
  1206. - --
  1207. Lothar Fritsch, Student der Universitaet des Saarlandes, Fachb. Informatik
  1208. e-mail: fritsch@fsinfo.cs.uni-sb.de    phone: (ger) 06821-72562
  1209.  
  1210.        "You don't have to sleep to see nightmares." - (Anne Clarke)
  1211.  
  1212. ---------------------------
  1213.  
  1214. End of C.S.M.P. Digest
  1215. **********************
  1216.